package com.ajavaer.framework.im.easemob.request;

import com.ajavaer.framework.config.EasemobImConfig;
import com.ajavaer.framework.im.easemob.model.EasemobFile;
import com.ajavaer.framework.im.easemob.model.MessageType;

import java.util.UUID;

public class EasemobMsgAudio extends EasemobMsg {
    private String filename = UUID.randomUUID().toString() + ".amr";
    private String secret;
    private String url;
    /**
     * 语音时间（单位：秒）
     */
    private Integer length;

    public EasemobMsgAudio(EasemobFile easemobFile, EasemobImConfig easemobImConfig) {
        super(MessageType.audio);
        this.secret = easemobFile.getShareSecret();
        this.url = "https://a1.easemob.com/" + easemobImConfig.getOrgName() + "/" + easemobImConfig.getAppName() + "/chatfiles/" + easemobFile.getUuid();
    }

    public String getFilename() {
        return filename;
    }

    public void setFilename(String filename) {
        this.filename = filename;
    }

    public String getSecret() {
        return secret;
    }

    public void setSecret(String secret) {
        this.secret = secret;
    }

    public String getUrl() {
        return url;
    }

    public void setUrl(String url) {
        this.url = url;
    }

    public Integer getLength() {
        return length;
    }

    public void setLength(Integer length) {
        this.length = length;
    }
}
